package org.example.xiaomi.util;

import com.alibaba.fastjson.JSON;
import org.example.xiaomi.vo.ResultVO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class HttpResponseUtil {
    public static void response(HttpServletResponse response, ResultVO resultVO) throws IOException {
        response.setContentType("application/json;charset=utf-8");
        PrintWriter out = response.getWriter();
        out.print(JSON.toJSON(resultVO));
        out.flush();
        out.close();
    }
}
